<?php

class PlayerServices {

    public static function GetAllPlayers() {
        $player = new Player();
        return $player->GetAll();
    }

    public static function GetPlayersByNational($national) {
        $player = new Player();
        return $player->GetPlayersByNational($national);
    }

    public static function PrepareResultSet($players, $squad_id) {
        $results = "";
        if($players) {
            $results .= "<ul>";
            foreach($players as $player) {
                $results .="<li>From " . $player->national_name . " - " .  $player->name . " - £" . number_format($player->worth) . " <a href='/squad/formationdo/player_id/$player->id/squad_id/$squad_id'>add</a></li>";
            }
            $results .= "</ul>";
        }
        return $results;
    }

    public static function GetPlayerById($id){
        $player = new Player();
        return $player->GetPlayerById($id);
    }


}

?>
